|
NcApi
|
#include <stdint.h>

Data Structures | |
| struct | NcApiHostAck |
| HostAck or HostNAck package received. More... | |
| struct | NcApiHostData |
| HostData package received. More... | |
| struct | NcApiHostDataHapa |
| HostDataHapa package received. More... | |
| struct | NcApiWesRequest |
| WesRequest package received. More... | |
| struct | NcApiWesResponse |
| WesResponse package received. More... | |
| struct | NcApiWesCmdMsg |
| struct | NcApiWesStatus |
| WesStatus package received. More... | |
| struct | NcApiRxHandlers |
| Set of application callbacks to handle any received messages. Each callback is optional allowing the application to register specific callbacks only for the message types of particular interest. More... | |
| struct | NcApiSendParams |
| Parameters for the NcApiSendAcknowledged function. More... | |
| struct | NcApiWesCmdParams |
| Parameters for the NcApiWesCmd function. More... | |
| struct | NcApiWesResponseParams |
| Parameters for the NcApiWesCmd function. More... | |
| struct | NcApi |
| RX and TX buffers for a particular UART. Managed by NcApi and as such the fields are considered internal to NcApi. More... | |
Macros | |
| #define | NCAPI_TXBUFFER_SIZE 32 |
| Default TX buffer size. Can be defined by the application. More... | |
| #define | NCAPI_MAX_PAYLOAD_LENGTH (NCAPI_TXBUFFER_SIZE-5) |
| #define | NCAPI_RXBUFFER_SIZE 255 |
| Default RX buffer size. Can be defined by the application. More... | |
Typedefs | |
| typedef struct NcApiHostAck | tNcApiHostAck |
| HostAck or HostNAck package received. More... | |
| typedef struct NcApiHostData | tNcApiHostData |
| HostData package received. More... | |
| typedef struct NcApiHostDataHapa | tNcApiHostDataHapa |
| HostDataHapa package received. More... | |
| typedef struct NcApiWesRequest | tNcApiWesRequest |
| WesRequest package received. More... | |
| typedef struct NcApiWesResponse | tNcApiWesResponse |
| WesResponse package received. More... | |
| typedef struct NcApiWesCmdMsg | tNcApiWesCmd |
| typedef struct NcApiWesStatus | tNcApiWesStatus |
| WesStatus package received. More... | |
| typedef void(* | pfnNcApiReadCallback) (uint8_t n, uint8_t *msg, uint8_t msgLength) |
| Application provided function that NcApi calls whenever any valid NeocCortec messages has been received. More... | |
| typedef void(* | pfnNcApiHostAckCallback) (uint8_t n, tNcApiHostAck *m) |
| Application provided function that NcApi calls when a HostAck or HostNAck message has been received. More... | |
| typedef void(* | pfnNcApiHostDataCallback) (uint8_t n, tNcApiHostData *m) |
| Application provided function that NcApi calls when a HostData message has been received. More... | |
| typedef void(* | pfnNcApiHostDataHapaCallback) (uint8_t n, tNcApiHostDataHapa *m) |
| Application provided function that NcApi calls when a HostDataHapa message has been received. More... | |
| typedef void(* | pfnNcApiWesRequestCallback) (uint8_t n, tNcApiWesRequest *m) |
| Application provided function that NcApi calls when a WesRequest message has been received. More... | |
| typedef void(* | pfnNcApiWesStatusCallback) (uint8_t n, tNcApiWesStatus *m) |
| Application provided function that NcApi calls when a WesStatus message has been received. More... | |
| typedef struct NcApiRxHandlers | tNcApiRxHandlers |
| Set of application callbacks to handle any received messages. Each callback is optional allowing the application to register specific callbacks only for the message types of particular interest. More... | |
| typedef struct NcApiSendParams | tNcApiSendParams |
| Parameters for the NcApiSendAcknowledged function. More... | |
| typedef struct NcApiWesCmdParams | tNcApiWesCmdParams |
| Parameters for the NcApiWesCmd function. More... | |
| typedef struct NcApiWesResponseParams | tNcApiWesResponseParams |
| Parameters for the NcApiWesCmd function. More... | |
| typedef struct NcApi | tNcApi |
| RX and TX buffers for a particular UART. Managed by NcApi and as such the fields are considered internal to NcApi. More... | |
Enumerations | |
| enum | NcApiWesCmdValues { NCAPI_WES_STOP = 0, NCAPI_WES_STARTSERVER = 1, NCAPI_WES_REQUESTSTATUS = 2, NCAPI_WES_STARTCLIENT = 3 } |
| enum | NcApiWesStatusValues { NCAPI_WES_STOPPED = 0, NCAPI_WES_SERVERRUNNING = 1, NCAPI_WES_CLIENTRUNNING = 2 } |
| enum | NcApiErrorCodes { NCAPI_OK = 0, NCAPI_ERR_NODEID = 1, NCAPI_ERR_DESTPORT = 2, NCAPI_ERR_PAYLOAD = 3, NCAPI_ERR_ENQUEUED = 4, NCAPI_ERR_NULLPAYLOAD = 5, NCAPI_ERR_NOARGS = 6 } |
Functions | |
| void | NcApiCallbackCtsActive (uint8_t n) |
| Callback from the application into NcApi whenever CTS becomes active. More... | |
| void | NcApiTxData (uint8_t n, uint8_t *finalMsg, uint8_t finalMsgLength) |
| Application provied function that NcApi calls if there is any pending data to be written to the UART. More... | |
| void | NcApiMessageWrittenCallback (uint8_t n, void *callbackToken, uint8_t *finalMsg, uint8_t finalMsgLength) |
| Application provided function that NcApi calls after it has succesfully written the message. More... | |
| void | NcApiRxDataReceived (uint8_t n, uint8_t byte) |
| Callback from the application into NcApi whenever a byte is received on the UART. More... | |
| void | NcApiInit () |
| Initializes the allocated instances of tNcApi. More... | |
| NcApiErrorCodes | NcApiSendAcknowledged (uint8_t n, tNcApiSendParams *args) |
| Sends one CommandAckowledged message. More... | |
| NcApiErrorCodes | NcApiSendWesCmd (uint8_t n, tNcApiWesCmdParams *args) |
| Sends one WesCmd message. More... | |
| NcApiErrorCodes | NcApiSendWesResponse (uint8_t n, tNcApiWesResponseParams *args) |
| Sends one WesResponse message. More... | |
| void | NcApiCancelEnqueuedMessage (uint8_t n) |
| Cancels any enqueued message. More... | |
Variables | |
| tNcApiRxHandlers | g_ncRx |
| Application defined and configured rx-handlers. More... | |
| tNcApi | g_ncApi [] |
| Application defined array of NcApi instances in use. More... | |
| uint8_t | g_numberOfNcApis |
| Application defined number of elements in the g_ncApi array. More... | |
| #define NCAPI_MAX_PAYLOAD_LENGTH (NCAPI_TXBUFFER_SIZE-5) |
| #define NCAPI_RXBUFFER_SIZE 255 |
Default RX buffer size. Can be defined by the application.
| #define NCAPI_TXBUFFER_SIZE 32 |
Default TX buffer size. Can be defined by the application.
| typedef void(* pfnNcApiHostAckCallback) (uint8_t n, tNcApiHostAck *m) |
Application provided function that NcApi calls when a HostAck or HostNAck message has been received.
| n | Index of tNcApi instance that the message was received from |
| m | Strongly typed message |
| typedef void(* pfnNcApiHostDataCallback) (uint8_t n, tNcApiHostData *m) |
Application provided function that NcApi calls when a HostData message has been received.
| n | Index of tNcApi instance that the message was received from |
| m | Strongly typed message |
| typedef void(* pfnNcApiHostDataHapaCallback) (uint8_t n, tNcApiHostDataHapa *m) |
Application provided function that NcApi calls when a HostDataHapa message has been received.
| n | Index of tNcApi instance that the message was received from |
| m | Strongly typed message |
| typedef void(* pfnNcApiReadCallback) (uint8_t n, uint8_t *msg, uint8_t msgLength) |
Application provided function that NcApi calls whenever any valid NeocCortec messages has been received.
| n | Index of tNcApi instance that the message was received from |
| msg | Pointer to the message |
| msgLength | Message length in bytes |
| typedef void(* pfnNcApiWesRequestCallback) (uint8_t n, tNcApiWesRequest *m) |
Application provided function that NcApi calls when a WesRequest message has been received.
| n | Index of tNcApi instance that the message was received from |
| m | Strongly typed message |
| typedef void(* pfnNcApiWesStatusCallback) (uint8_t n, tNcApiWesStatus *m) |
Application provided function that NcApi calls when a WesStatus message has been received.
| n | Index of tNcApi instance that the message was received from |
| m | Strongly typed message |
| typedef struct NcApiHostAck tNcApiHostAck |
HostAck or HostNAck package received.
| typedef struct NcApiHostData tNcApiHostData |
HostData package received.
| typedef struct NcApiHostDataHapa tNcApiHostDataHapa |
HostDataHapa package received.
| typedef struct NcApiRxHandlers tNcApiRxHandlers |
Set of application callbacks to handle any received messages. Each callback is optional allowing the application to register specific callbacks only for the message types of particular interest.
| typedef struct NcApiSendParams tNcApiSendParams |
Parameters for the NcApiSendAcknowledged function.
| typedef struct NcApiWesCmdMsg tNcApiWesCmd |
| typedef struct NcApiWesCmdParams tNcApiWesCmdParams |
Parameters for the NcApiWesCmd function.
| typedef struct NcApiWesRequest tNcApiWesRequest |
WesRequest package received.
| typedef struct NcApiWesResponse tNcApiWesResponse |
WesResponse package received.
| typedef struct NcApiWesResponseParams tNcApiWesResponseParams |
Parameters for the NcApiWesCmd function.
| typedef struct NcApiWesStatus tNcApiWesStatus |
WesStatus package received.
| enum NcApiErrorCodes |
| enum NcApiWesCmdValues |
| enum NcApiWesStatusValues |
| void NcApiCallbackCtsActive | ( | uint8_t | n | ) |
Callback from the application into NcApi whenever CTS becomes active.
| n | Index of tNcApi instance that the CTS interrupt relates to |
| void NcApiCancelEnqueuedMessage | ( | uint8_t | n | ) |
Cancels any enqueued message.
| n | Index of tNcApi instance where the message should be dequeued |
| void NcApiInit | ( | ) |
Initializes the allocated instances of tNcApi.
| void NcApiMessageWrittenCallback | ( | uint8_t | n, |
| void * | callbackToken, | ||
| uint8_t * | finalMsg, | ||
| uint8_t | finalMsgLength | ||
| ) |
Application provided function that NcApi calls after it has succesfully written the message.
| n | Index of tNcApi instance that message was written to |
| callbackToken | Application provided context / token / tag |
| finalMsg | Pointer to the message |
| finalMsgLength | Message length in bytes |
| void NcApiRxDataReceived | ( | uint8_t | n, |
| uint8_t | byte | ||
| ) |
Callback from the application into NcApi whenever a byte is received on the UART.
| n | Index of tNcApi instance that the byte relates to |
| byte | The byte received |
| NcApiErrorCodes NcApiSendAcknowledged | ( | uint8_t | n, |
| tNcApiSendParams * | args | ||
| ) |
Sends one CommandAckowledged message.
| n | Index of tNcApi instance that the message should be sent via |
| args | Pointer to instance of tNcApiSendParams that holds the parameters |
| NcApiErrorCodes NcApiSendWesCmd | ( | uint8_t | n, |
| tNcApiWesCmdParams * | args | ||
| ) |
Sends one WesCmd message.
| n | Index of tNcApi instance that the message should be sent via |
| args | Pointer to instance of tNcApiWesCmdParams that holds the parameters |
| NcApiErrorCodes NcApiSendWesResponse | ( | uint8_t | n, |
| tNcApiWesResponseParams * | args | ||
| ) |
Sends one WesResponse message.
| n | Index of tNcApi instance that the message should be sent via |
| args | Pointer to instance of tNcApiWesResponse that holds the parameters |
| void NcApiTxData | ( | uint8_t | n, |
| uint8_t * | finalMsg, | ||
| uint8_t | finalMsgLength | ||
| ) |
Application provied function that NcApi calls if there is any pending data to be written to the UART.
| n | Index of tNcApi instance that the data should be written to, ie. which UART |
| finalMsg | Pointer to the buffer |
| finalMsgLength | Number of bytes to be written |
| tNcApiRxHandlers g_ncRx |
Application defined and configured rx-handlers.
| uint8_t g_numberOfNcApis |
Application defined number of elements in the g_ncApi array.
1.8.10